load("//bazel:api.bzl", "mojo_test")

package(default_visibility = ["//visibility:private"])

_EXTRA_CONSTRAINTS = {
    "test_reduce_atomic.mojo": select({
        "//:apple_gpu": ["@platforms//:incompatible"],
        "//conditions:default": [],
    }),  # FIXME: MOCO-2423
    "test_elementwise.mojo": select({
        "//:apple_gpu": ["@platforms//:incompatible"],
        "//conditions:default": [],
    }),  # FIXME: MOCO-2941
    "test_reduce.mojo": select({
        "//:apple_gpu": ["@platforms//:incompatible"],
        "//conditions:default": [],
    }),  # FIXME: MOCO-2941
}

[
    mojo_test(
        name = src + ".test",
        size = "large",
        srcs = [src],
        tags = ["gpu"],
        target_compatible_with = ["//:has_gpu"] + _EXTRA_CONSTRAINTS.get(src, []),
        deps = [
            "@mojo//:stdlib",
            "@mojo//:test_utils",
        ],
    )
    for src in glob(["*.mojo"])
]
